package com.christina.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.christina.entity.Task;
import com.christina.mapper.TaskMapper;
import com.christina.service.TaskService;
import org.springframework.stereotype.Service;

/**
 * 任务服务实现类
 * 
 * @author Christina
 */
@Service
public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements TaskService {
    
    @Override
    public Task createTask(Task task) {
        save(task);
        return task;
    }
    
    @Override
    public boolean updateTaskStatus(Long taskId, String status) {
        Task task = getById(taskId);
        if (task != null) {
            task.setStatus(status);
            return updateById(task);
        }
        return false;
    }
    
    @Override
    public boolean deleteTask(Long taskId) {
        return removeById(taskId);
    }
}